<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<script>
  var t = async_test("Make sure that timing assumptions are accurate when document write preloading is off");
  // We reject scripts with "for", so rename window.performance.
  window.perf = window.performance;
</script>

<script>
  if (window.perf)
    var boundedStart = window.perf.now();
  var src = '../../resources/dummy.js';
  document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
</script>

<script>
  window.addEventListener("load", t.step_func(function() {
    window.performance.getEntriesByType('resource').forEach(function(r) {
      if (r.name.indexOf('dummy.js') != -1) {
        assert_greater_than(r.startTime, 0);
        assert_greater_than(r.startTime, boundedStart);
        t.done();
      }
    });
  }));
</script>

